﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace DB_NH.DB_Map.PWF
{
    using NHibernate;
    using NHibernate.Mapping.ByCode;
    using NHibernate.Mapping.ByCode.Conformist;

    using DB_NH.DB_Model.PWF;

    public class wf_pwf_map : ClassMapping<wf_pwf>
    {
        public wf_pwf_map()
        {
            Id(x => x.n_id, map =>
            {
                map.Length(40);
                map.Column(wf_pwf.Columns.n_id);
            });
            Property(x => x.is_valid, map => map.Column(wf_pwf.Columns.is_valid));
            Property(x => x.create_date, map => map.Column(wf_pwf.Columns.create_date));

            //所属项目
            ManyToOne(x => x.proj, map =>
            {
                map.Column(wf_pwf.Columns.proj_id);
                map.NotNullable(false);
            });

            //操作员
            ManyToOne(x => x.user, map =>
            {
                map.Column(wf_pwf.Columns.user_id);
                map.NotNullable(false);
            });

            Property(x => x.jehj, map => map.Column(wf_pwf.Columns.jehj));
            Property(x => x.pwrs, map => map.Column(wf_pwf.Columns.pwrs));
            Property(x => x.remark, map =>
            {
                map.Length(10000);
                map.Column(wf_pwf.Columns.remark);
            });
            Property(x => x.title, map =>
            {
                map.Length(200);
                map.Column(wf_pwf.Columns.remark);
            });

            Table(wf_pwf.TableName);
        }
    }
}
